//
// Created by yanhai on 2020/3/28.
//

/**
 * C++类有一个经典的分类：带指针的类和不带指针的类
 * 分别有两个经典的类：string和complex
 *
 * 本例将介绍不带指针的类：complex
 */

#include <iostream>
#include "complex.h"

using namespace std;

int main()
{
    complex c1(2, 1);
    complex c2;
    cout << c1 << endl;
    cout << c2 << endl;

    c2 = c1 + 5;
    c2 = 7 + c1;
    c2 = c1 + c2;

    c2 = -c1;
    c2 = +c1;

    c2 += c1;
    c2 += 3;
    c2 += c1 += 1;

    cout << c1.real() << endl;
    cout << c1.imag() << endl;

    cout << real(c2) << endl;
    cout << imag(c2) << endl;

    cout << (c1 == c2) << endl;
    cout << (c1 != c2) << endl;
    cout << c1 << conj(c1) << endl;
    return 0;
}
